﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;

namespace MQTT.Client.App
{
    public class MqttClientService : IHostedService
    {

        private readonly IMqttClientManager ClientManager;
        public MqttClientService(IMqttClientManager clientManager)
        {
            ClientManager = clientManager;
        }

        public async Task StartAsync(CancellationToken cancellationToken)
        {
            
            await ClientManager.StartAsync();
        }

        public async Task StopAsync(CancellationToken cancellationToken)
        {
            await ClientManager.StopAsync();
        }
    }
}
